package com.weitu.threeSimultaneities.occHealth.service.impl;

import com.weitu.threeSimultaneities.occHealth.entity.OccHealthDesign;
import com.weitu.threeSimultaneities.occHealth.mapper.OccHealthDesignMapper;
import com.weitu.threeSimultaneities.occHealth.service.OccHealthDesignService;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class OccHealthDesignServiceImpl implements OccHealthDesignService {
    @Autowired
    private OccHealthDesignMapper occHealthDesignMapper;


    @Override
    public OccHealthDesign selectBySubjectId(String id) {
        return this.occHealthDesignMapper.selectBySubjectId(id);
    }

    @Override
    public int deleteBySubjectId(String id) {
        return this.occHealthDesignMapper.deleteBySubjectId(id);
    }

    @Override
    @Transactional
    public int insertSelective(Map<String,Object> paramMap) {
        this.occHealthDesignMapper.deleteBySubjectId(paramMap.get("subjectId").toString());
        return this.occHealthDesignMapper.insertSelective(paramMap);
    }
}